Correctly handle the "zh-Hans" language (bsc#1238584)#2314
Conversation
mvidner
left a comment
There was a problem hiding this comment.
- Some more cleanup in the code you have already touched
- Unfortunately Weblate is giving us a hybrid of the two language standards, IMHO we should fight back or be forever stuck with a mess
| @@ -127,7 +127,13 @@ function languageFromLocale(locale: string): string { | |||
| * @see https://www.rfc-editor.org/info/bcp78 | |||
| */ | |||
| function languageToLocale(language: string): string { | |||
There was a problem hiding this comment.
please note there is also an inverse languageFromLocale function above, which also needs fixing, and testing
|
May I suggest to prevent crashes by catching exceptions in the formatList function? |
for testing more languages
Agama-weblate commit: 4406d86c459da8468302098bf8d6b7e51dd4b065
Updating the web translation files from the agama-weblate repository
imobachgs
left a comment
There was a problem hiding this comment.
In general it looks great. Just a minor comment about the formatList fallback.
mvidner
left a comment
There was a problem hiding this comment.
LGTM, thanks!
Consider applying a jq explanation
| install -D -m 0644 --target-directory=%{buildroot}%{_datadir}/agama/web_ui %{_builddir}/agama/dist/*.{css,gz,html,js,json,map,svg} | ||
| install -D -m 0644 --target-directory=%{buildroot}%{_datadir}/agama/web_ui/fonts %{_builddir}/agama/dist/fonts/*.ttf | ||
| install -D -m 0644 --target-directory=%{buildroot}%{_datadir}/agama/web_ui/assets/logos %{_builddir}/agama/src/assets/products/*.svg | ||
| install -D -m 0644 --target-directory=%{buildroot}%{_datadir}/agama/web_ui/assets/logos %{_builddir}/agama/dist/assets/logos/*.svg |
There was a problem hiding this comment.
NP: in the future we might want to go with a web/install.sh approach like the other parts of Agama do (part of #2103). I forgot to do it because I was not doing any changes in the front end at the time
There was a problem hiding this comment.
Yes, would be nice to unify this to have a single place for changes.
Co-authored-by: Martin Vidner <mvidner@suse.com>
Prepare to release Agama 15: * #2258 * #2270 * #2277 * #2279 * #2283 * #2284 * #2285 * #2286 * #2287 * #2288 * #2291 * #2292 * #2293 * #2295 * #2297 * #2299 * #2300 * #2301 * #2302 * #2303 * #2305 * #2306 * #2307 * #2308 * #2309 * #2313 * #2314 * #2315 * #2317 * #2318 * #2319 * #2320 * #2321 * #2322 * #2323 * #2324 * #2325 * #2328 * #2329 * #2330 * #2331 * #2335 * #2336 * #2337 * #2338 * #2339 * #2340 * #2342 * #2345 * #2346 * #2348 * #2349 * #2350 * #2351 * #2352 * #2353 * #2354 * #2355 * #2357 * #2358 * #2359 * #2360 * #2361 * #2362 * #2363 * #2364 * #2365 * #2366 * #2368 * #2369 * #2370 * #2371 * #2372 * #2374 * #2377 * #2378 * #2379 * #2380 * #2381 * #2382 * #2384 * #2385 * #2386 * #2388 * #2389 * #2390 * #2391 * #2392 * #2394 * #2397 * #2398 * #2401 * #2403
Problem
pt_BRlanguage as it also uses a country code. (All other languages use just a simple language code without any separator.) But it is less serious as thept_BRlocale is known by glibc so we do not need to do any additional conversions besides using the correct language separator.zh_TW.UTF-8and IETF language tags such aszh-Hant. Agama sometimes uses a punctuation-only conversion which only works for some cases.Solution
zh_Hansin Weblate tozh_CNso we do not need to do any conversions-) separator in all places, avoid unnecessary conversions, convert to underscore only when sending to the backend_) separator to dash (-) when importing the frontend translations from WeblateIntl.ListFormatformatting function, in case of exception fallback to a simple formatting function with comma separator (", ")Notes
C.UTF-8anden_US.UTF-8locales were present in the Live ISO. Unfortunately the filtering regexp was not updated after renaming the PO translation files frompo.<lang>.jstopo-<lang>.js. 😱languages.jsonfile. That allows more precise filtering. In the past we kept e.g. allde_DE,de_AT,de_CHfor German language. Now we know that after selecting German thede_DElocale will be used so we can delete thede_ATandde_CHlocales from the live ISO.Testing
Intl.ListFormatfunction is used in theNew partitions will be created for "/" <and> "swap"textzh_CN.UTF-8)locale -a)